import http from '../utils/request'

export const list = {
  Register: {
    url: 'register',
    method: 'post',
  },
  loginUser: {
    url: 'auth/login',
    method: 'post'
  },
  phonelogin:{
    url: 'auth/smslogin',
    method: 'post'
  },
  reset: {
    url: 'check/verify',
    method: 'post'
  },
  setpwd: {
    url: 'setpwd',
    method: 'post'
  },
  getPhoneCaptcha: {
    url: 'auth/verify',
    method: 'post'
  },
  getImgCaptcha: {
    url: 'captcha',
    method: 'get'
  },
  wxLogin: {
    url: '/api/wxlogin/img',
    method: 'get'
  }
}

//注册账号
export const Register = params => {
  return http.request({
    ...list.Register,
    params
  })
}

//账号密码登录
export const loginUser = params => {
  return http.request({
    ...list.loginUser,
    params
  })
}

//手机号码登录
export const phonelogin = params => {
  return http.request({
    ...list.phonelogin,
    params
  })
}

//重置密码
export const reset = params => {
  return http.request({
    ...list.reset,
    params
  })
}

//找回密码
export const setpwd = params => {
  return http.request({
    ...list.setpwd,
    params
  })
}

//获取手机验证码
export const getPhoneCaptcha = params => {
  return http.request({
    ...list.getPhoneCaptcha,
    params
  })
}

//获取图片验证码
export const getImgCaptcha = params => {
  return http.request({
    ...list.getImgCaptcha,
    params
  })
}

